import axios from 'axios';

/**
 * 云平台获取天气接口
 */
export const getWeatherByCloudApi = async (location) => {
	return await axios({
		baseURL: 'https://api.seniverse.com/v3/weather/daily.json',
		method: 'get',
		params: {
			key: 'SX20ez6PgtC-kvn3P',
			location: location,
			language: 'zh-Hans',
			unit: 'c',
			start: -1,
			days: 5,
		},
	});
};
/**
 * 云平台获取空气质量接口
 */
export const getAirQualityByCloudApi = async (location) => {
	return await axios({
		baseURL: 'https://api.seniverse.com/v3/air/daily.json',
		method: 'get',
		params: {
			key: 'SX20ez6PgtC-kvn3P',
			location: location,
			language: 'zh-Hans',
			days: 5,
		},
	});
};

/**
 * 龙泉山获取天气接口
 */
export const getWeatherByLqmsApi = async () => {
	return await axios({
		baseURL: import.meta.env.VITE_APP_API_BASE_SCHOOL,
		url: '/ruoyi/sensors/public/devices/202500002/sensors',
		// url: "/api/ruoyi/sensors/public/devices/202500002/sensors",
		method: 'get',
	});
};
